*
* Table B3: Demographics, socioeconomic status, academic achievement and dominated choices
*
* Input table: 
*	"${data_applicant_level_tidy}"
*
* Output file: 
*	/results/TableB3.tex
*

use "${data_applicant_level_tidy}", clear

* Restrict to the eligible sample
keep if eligibility == 1 & any_ba_listed == 1 & no_funded_version_at_all == 0

do "${helpers_dir}/addVariablesForRegressionAnalysis.do"

qui reg dominated_choice unempl_rate unempl_missing i.year, r
est store est1

qui reg dominated_choice grossincome grossincome_missing i.year, r
est store est2

qui reg dominated_choice disadv i.year, r
est store est3

qui reg dominated_choice GPA11_std GPA11_missing i.year, r
est store est4

qui reg dominated_choice voc_school other_school i.year, r
est store est5

qui reg dominated_choice countycapital town village i.year, r
est store est6

qui reg dominated_choice female i.year, r
est store est7

qui esttab est1 est2 est3 est4 est5 est6 est7 ///
	using "${result_dir}/TableB3.tex", ///
	drop(_cons *_missing) b(3) se(3) r2 indicate("Year FE = *year") ///
	stat(r2, fmt(%18.2g) ///
	labels("R-squared")) ///
	label star(* 0.10 ** 0.05 *** 0.01) replace noomitted nogaps f noobs ///
	nomtitles nonumbers nolines ///
	order(unempl_rate grossincome disadv GPA11_std voc_school other_school countycapital town village female)

* ------------------------------------------------------------------------------	
* Table notes:
qui sum GPA11_missing
di "The sample includes " round(r(N)) " ROLS."

qui sum dominated_choice
di "The share of dominated choices is " round(r(mean)*100) " %."
